﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace OnWork.Admin.Util.Configs
{
    /// <summary>
    /// 读取配置扩展]
    /// </summary>
    public static class ConfigServiceCollectionExtensions
    {
        public static IServiceCollection AddConfig(this IServiceCollection services, IConfiguration config)
        {
            services.Configure<JwtConfiguration>(config.GetSection(JwtConfiguration.KEY));

            services.Configure<List<ConnectionConfiguration>>(config.GetSection("ConnectionConfigs"));

            return services;
        }
    }
}